package org.darkforest.dao.mapper;

import org.darkforest.dao.annotation.DBMapper;
import org.darkforest.model.*;

import java.util.List;
import java.util.Map;

@DBMapper
public interface GoodsMapper {
    int deleteByPrimaryKey(Integer goodsId);

    int insert(Goods record);

    int batchAddGoods(List<Goods> record);

//    int insertSelective(Goods record);

    Goods selectByPrimaryKey(Integer goodsId);

    Goods selectById(Integer goodsId);

    int updateByPrimaryKeySelective(Goods record);

    int updateByPrimaryKeyWithBLOBs(Goods record);

    int updateByPrimaryKey(Goods record);

    int updateStoreName(Goods record);

    //根据条件查询 goods信息
    List<Goods> findGoodsByCondition(Goods goods);
    //根据商品ID列表获取商品列表
    List<Goods> findGoodsByList(List<String> goodsIdList);


//    List<Goods> selectByFuzzyName(GoodSearchBean searchBean);
//
//    List<Goods> queryAllGoods(GoodSearchBean searchBean);

    /**
     * 分页查询
     * @param searchBean
     * @return
     */
    List<Goods> selectByFuzzyName(GoodSearchBean searchBean);

    List<Goods> queryAllGoods(GoodSearchBean searchBean);

    Goods getGoodsById(Integer goodsId);

    /**
     * 获取不包含text数据的基本商品信息查询
     * @param goods
     * @return
     */
    List<Goods> findSimpleGoodsByCond(Goods goods);
    List<Goods> searchGoodsByPage(GoodSearchBean goods);
    void updateGoodsPriceBath(Map<String, Object> goodsIdMap);
    List<Goods> selectSellerList(GoodSearchBean searchBean);
    void updateGoodsStorage(Goods goods);
    void updateGoodsStorageDirect(OrderGoods orderGoods);

    void soldOutStoreGoods(Map map);

    void restoreGoodsStorege(Goods goods);

    /**
     * 商品下架
     * @param conditionMap
     */
    void modifyGoodsStatusByBatch(Map conditionMap);

    Map<String,Object> findPriceSaleByCondition(Map<String, Object> paramMap);

    List<Goods> selectGoodsStorageAlarm();

    List<Map<String,Object>> findTimeRangeByCondition(GoodSearchBean goods);
    /****
     * 查询首页推荐展位商品
     */
    List<Goods> findBoothGoodsByCond(Goods goods);
    /****
     * 查询首页推荐展位信息
     */
    List<Goods> findRecommendGoodsByCond(Goods goods);


    /**
     * 根据goodsCommonid 以及 规格属性值 查询唯一商品
     * @param goods
     * @return
     */
    Goods getGoodsInfoByCondtion(Goods goods);

    List<GoodsStatistical> selectGoodsSales(GoodsStatistical goodsStatistical);

    List<SupplyChannelStatistics> selectSupplyChannelStatistics(SupplyChannelStatistics supplyChannelStatistics);

    void clearGoodsOld(Map map);
}